<?php $this->load->view('home/layout/header') ?>
    <div class="widthMax log-cloec">
        <header class="logistics-head flex">
            <a href="<?php echo isset($_SERVER['HTTP_REFERER']) ? "javascript:history.go(-1);" : site_url('home/winners/grid'); ?>" class="log-return">
                <i class="iconfont icon-zuojiantou"></i>
            </a>
            <a href="<?php echo site_url('home/ucenter/index'); ?>" class="drax-beizhu">
                <i class="iconfont">&#xe616;</i>
            </a>
            <div class="log-title flex-1">
                <?php echo  $winner->status == 2 ? '领取成功' : '查看详情';?>
            </div>
        </header>
        <div class="log-section">
            <div class="log-porsd">
                <a href="javascript:;" class="log-img">
                    <img src="<?php echo $this->config->show_image_url($winner->image); ?>" alt="<?php echo $winner->prize_name; ?>">
                </a>
                <p><?php echo $winner->prize_name; ?></p>
            </div>
            <div class="log-size"></div>
        </div>
        <?php if ($winner->prize_type == 1) : ?>
            <div class="log-vusize">
                <?php if ($winner->address) : ?>
                    <?php  $address =  json_decode($winner->address); ?>
                    <h6 class="flex">
                        <div class="flex-1">收货人：<?php echo $address->receiver_name; ?></div>
                        <div class="vusize-title"><?php echo $address->tel; ?></div>
                    </h6>
                    <p>收货地址：<?php echo $address->detailed; ?></p>
                <?php endif; ?>
                <div class="log-stics">
                    <?php if ( !empty($winner->links))  : ?>
                    <a href="<?php echo $winner->links; ?>" class="la-stics flex">
                        <p class="flex-1">
                            <i class="iconfont">&#xe642;</i>去奖品站点看看
                        </p>
                        <i class="iconfont">&#xe614;</i>
                    </a>
                    <?php endif; ?>
                <?php if ($winner->number && $winner->status == 3) : ?>
                        <h3 class="flex">
                            <p class="flex-1">
                                <i class="iconfont">&#xe625;</i>物流信息
                            </p>
                            <i class="iconfont">&#xe614;</i>
                        </h3>
                        <div class="log-company">
                            <p>物流公司：<?php echo $winner->name; ?></p>
                            <p>运单号码：<?php echo $winner->number;?></p>
                        </div>
                        <?php $express = json_decode($winner->context); ?>
                        <ul class="log-ticul">
                            <?php if( ! empty($express) ) : ?>
                                <?php foreach($express as $key=>$value) : ?>
                                    <li  <?php if ( $key == 0 ){echo 'class="active"';} ?>>
                                        <div class="log-text">
                                            <p><?php echo $value->context; ?></p>
                                            <span><?php echo $value->time; ?></span>
                                        </div>
                                        <i class="log-circle"></i>
                                    </li>
                                <?php endforeach; ?>
                            <?php else : ?>
                                <li>暂无物流信息</li>
                            <?php endif; ?>
                        </ul>
                <?php endif ?>
                </div>
            </div>
        <?php endif; ?>
        <ul class="log-room">
            <li>
            <?php if ($winner->prize_type == 1 && $winner->status == 2) : ?>
                <p>我们将会尽快为您处理，请耐心等待。</p>
            <?php elseif ($winner->prize_type == 2): ?>
                <?php if ($winner->status == 2) : ?>
                    <p>我们将会在第一时间与您取得联系,请耐心等待。</p>
                <?php elseif ($winner->status == 3) : ?>
                    <p>我们将会以短信的方式发送给您电子票,请耐心等待!</p>
                <?php endif; ?>
            <?php elseif ($winner->prize_type == 3 && $winner->status == 3): ?>
                <p>已放入您的账户</p>
                <a href="<?php echo site_url('home/ucenter/index'); ?>" class="log-make">查看账户余额</a>
            <?php endif; ?>
            </li>
            <li>
                <p>如有疑问，请联系客服</p>
                <a href="tel:400-0571-648" class="log-link">
                    <i class="iconfont">&#xe623;</i>联系客服
                </a>
            </li>
        </ul>
        <?php if ($winner->prize_type == 3) : ?>
            <div class="log-rule">
                <h5>积分使用规则</h5>
                <div class="rule-text">
                    <h6>1、什么是积分</h6>
                    <p>积分是平台为用户购买产品提供的抵用金，1元积分等同于价值1元人民币。持有积分的用户购买平台相关产品时可用积分抵钱。</p>
                    <h6>2、抽中的积分有什么用？</h6>
                    <p>1）积分抵钱，积分可以当“钱”用，购买平台相关产品时可进行部分抵扣。</p>
                    <p>2）积分兑换，到积分商城兑换指定产品（包括门票、商品等)。</p>
                    <p class="red">注：具体使用规则请参考产品详情</p>
                    <h6>3、如何查看中奖的积分？</h6>
                    <p>积分领取成功后，可到我的账户进行查看。</p>
                    <h6>4、积分不够，怎么办？</h6>
                    <p>1）抽奖赚取，您可通过您已参与过抽奖的通道或登录<a href="<?php echo site_url(); ?>">平台</a>的幸运大抽奖页面，每天参与抽奖获得积分。</p>
                    <p>2）下载手机客户端，获得积分。</p>
                </div>
                <p class="avow">积分的具体使用规则，最终解释权归公司所有。</p>
            </div>
        <?php else : ?>
            <a href="<?php echo site_url('tourism/tourism'); ?>" class="log-goods">
                进入平台去挑好货<i class="iconfont">&#xe614;</i>
            </a>
        <?php endif; ?>
    </div>
    <div class="log-foot" data-am-sticky>
        <i class="iconfont">&#xe626;</i> <?php echo $winner->status == 2 ? '正在处理' : '已发放'; ?>
    </div>
        <!-- 游币才显示 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
        <div class="draw-winning lingjiang">
          <div class="widthMax draw-cleos">
                <img src="/skins/home/images/lingjiang.png">
                <a href="javascript: void(0)" class="draw-close" data-am-modal-close>&times;</a>
                <div class="draw-botrue">
                    <div class="botrue-img">
                        <img src="/skins/home/images/you.png">
                    </div>
                    <div class="botrue-text">
                        <h5>领取成功!</h5>
                        <div class="draw-details">
                            <a href="<?php echo empty($page5->bonus_links) ? ($this->config->sales_url. 'm/weeksales/grid') : $page5->bonus_links;?>">立即使用</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php $this->load->view('home/layout/footer'); ?>
<script type="text/javascript">
$(function(){
    <?php if ($winner->prize_type == 3) : ?>
    $('#doc-modal-1').modal();
    <?php endif; ?>
});
</script>
<?php js('home', 'pages/lottery')?>
